package com.group.eams.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.group.eams.pojo.dto.AssetBorrowQueryDto;
import com.group.eams.pojo.dto.FixedAssetDetailQueryDto;
import com.group.eams.pojo.entity.AssetBorrow;
import com.group.eams.pojo.vo.AssetBorrowListVo;
import com.group.eams.pojo.vo.FixedAssetDetailListVo;
import com.group.eams.service.AssetBorrowService;
import com.group.eams.mapper.AssetBorrowMapper;
import org.springframework.stereotype.Service;

/**
* @author 恩哲欣
* @description 针对表【asset_borrow(资产借用表)】的数据库操作Service实现
* @createDate 2024-10-29 16:09:34
*/
@Service
public class AssetBorrowServiceImpl extends ServiceImpl<AssetBorrowMapper, AssetBorrow> implements AssetBorrowService{

    @Override
    public Page<AssetBorrowListVo> findAssetBorrowList(AssetBorrowQueryDto assetBorrowQueryDto) {
        Page<AssetBorrowListVo> page = new Page<>(assetBorrowQueryDto.getPage(), assetBorrowQueryDto.getLimit());
        return getBaseMapper().findAssetBorrowList(page, assetBorrowQueryDto);
    }

    @Override
    public AssetBorrow findByApplicationNum(String applicationNum) {
        return getBaseMapper().findByApplicationNum(applicationNum);
    }

    @Override
    public Page<FixedAssetDetailListVo> findByQueryDto(FixedAssetDetailQueryDto fixedAssetDetailQueryDto) {
        Page<FixedAssetDetailListVo> page = new Page<>(fixedAssetDetailQueryDto.getPage(), fixedAssetDetailQueryDto.getLimit());
        return getBaseMapper().findByQueryDto(page, fixedAssetDetailQueryDto);
    }

    @Override
    public int deleteByApplicationNum(String applicationNum) {
        return getBaseMapper().deleteByApplicationNum(applicationNum);
    }
}
